package com.manager.user.controller;

import com.common.result.Result;
import com.manager.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/account")
@Api(description = "账号管理")
@CrossOrigin(origins = "*")
public class AccountController {

    @Resource
    private UserService userService;

    @ApiOperation(value = "账号基本资料修改")
    @PostMapping("/modify-info")
    public Result modifyInfo(Integer id,String name){
        return userService.modifyInfo(id,name);
    }

    @ApiOperation(value = "账号密码修改")
    @PostMapping("/modify-password")
    public Result modifyPassword(Integer id,String oldPassword,String newPassword){
        return userService.modifyPassword(id,oldPassword,newPassword);
    }
}
